<extend name="Base/common2"/>
<block name="body">
<div id="J_main" class="container main">
    <!-- login start-->
    <section class="login">
        <h2>登录</h2>
        <form id="J_login" action="{:U('Public/login')}" method="post" novalidate="novalidate">
            <fieldset>
                <input id="J_mobile" class="form-input" type="text" name="mobile" maxlength="11" minlength="11" placeholder="手机号">
            </fieldset>
            <fieldset>
                <input id="J_password" class="form-input" type="password" name="password" maxlength="12" minlength="8" placeholder="密码">
            </fieldset>
            <fieldset>
                <input class="form-input form-code" type="text" name="check_code" maxlength="6" minlength="6" placeholder="请输入验证码"><img class="J_get-sms form-get-sms" src="{:U('Public/getVerifyCode')}" onclick="this.src='{:U(\'Public/getVerifyCode\')}'+'&'+Math.random();">
            </fieldset>
            <fieldset>
                <label class="J_radio form-radio" for="role_1"><input id="role_1" type="radio" name="role" value="jia" />我是需求方</label>
                <label class="J_radio form-radio" for="role_2"><input id="role_2" type="radio" name="role" value="yi" />我是服务方</label>
            </fieldset>
            <button class="btn btn-orange submit" type="submit" style="border: none">登录</button><br />
            <a class="btn btn-orange submit" href="{:U('Public/register')}">没有账号先注册</a>
        </form>
    </section>
    <!-- login end -->
</div>
</block>
<block name="script">
    <script>
        var radio1 = document.getElementById('role_1');
        var radio2 = document.getElementById('role_2');

        radio1.onclick = function () {
            $('#role_1').parent().addClass('active');
            $('#role_2').parent().removeClass('active');
        };
        radio2.onclick = function () {
            $('#role_2').parent().addClass('active');
            $('#role_1').parent().removeClass('active');
        }



    </script>

</block>
